import request from '@/utils/request'

// 登录方法
export function loginApi(username, password) {
  const data = { username, password }
  return request({ url: '/login', method: 'post', data })
}

// 获取用户详细信息
export function getInfoApi() {
  return request({
    url: '/getInfo',
    method: 'get'
  })
}

// 退出方法
export function logoutApi() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

// 用户密码重置
export function updateUserPwdApi(oldPassword, newPassword) {
  const data = {
    oldPassword,
    newPassword
  }
  return request({
    url: '/system/user/profile/updatePwd',
    method: 'put',
    params: data
  })
}